#include <mgapiall.h>

#include "animation_player_controller.h"

// Plug-in declaration
mgDeclarePlugin("TedLai",                                // vendor name
                "tl_animation_player",                   // plug-in name
                "3e8ce670-2d75-11d7-9934-005004d6e8a6"); // uuid string

// Plug-in initialization function
MGPIDECLARE(mgbool) mgpInit (mgplugin plugin, int* argc, char* argv [])
{
   mgmodulehandle moduleHandle = mgGetModuleHandle (plugin);
   mgresource resource = mgLoadResource (moduleHandle);
   mgplugintool pluginTool = mgRegisterEditor (
      plugin, "TL_AnimationPlayer",
      tl::StartAnimationPlayer, resource,
      MTA_VERSION, "1.0",
      MTA_MENULOCATION, MMENU_VIEW,
      MTA_MENULABEL, "Animation Player...",
      MG_NULL);

   return pluginTool ? MG_TRUE : MG_FALSE;
}

// Plug-in termination function
MGPIDECLARE(void) mgpExit (mgplugin plugin)
{
   mgmodulehandle moduleHandle = mgGetModuleHandle (plugin);
   mgresource resource = mgLoadResource (moduleHandle);

   mgUnregisterAllTools (plugin);
   mgUnloadResource (resource);
}